﻿@model IEnumerable<SWTI_BlackSoft_CSharp.Models.Unidad>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")

    @using (Html.BeginForm("Index", "Unidades", FormMethod.Get))
    {
        <p> 
            Placa: @Html.TextBox("busqueda")
            Año: @Html.DropDownList("search_anio", "Todos")
            <input type="submit" value="Filtrar" />
        </p>
    }
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.placa)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.anio)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.capacidad)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.motor)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.estado)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.placa)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.anio)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.capacidad)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.motor)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.estado)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.id }) |
            @Html.ActionLink("Details", "Details", new { id=item.id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.id })
        </td>
    </tr>
}

</table>
